package com.aifast.system.log.controller;

import com.aifast.common.base.Controller;
import com.aifast.common.base.R;
import com.aifast.common.layui.LayuiDataTable;
import com.aifast.system.log.entity.LogLogin;
import com.aifast.system.log.service.LogLoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 登录日志 前端控制器
 * </p>
 *
 * @author fujian
 * @since 2022-01-07
 */
@RestController
@RequestMapping("/log/logLogin")
public class LogLoginController extends Controller {

    @Autowired
    private LogLoginService service;

    @GetMapping("list")
    public LayuiDataTable list() {
        return service.list(getSearchValue(),get("startDate"),get("endDate"), getPage());
    }

//    @PostMapping("add")
    public R add(LogLogin logLogin) {
        return service.insertOrUpdate(logLogin) ? OK() : ERROR();
    }

    @GetMapping("info")
    public R info() {
        return service.info(getInt("id"));
    }

//    @GetMapping("del")
    public R del() {
        return service.del(getInt("id"), get("ids")) ? OK() : ERROR();
    }

}

